<template>
	<view style="width:700upx;margin:25upx;">
		<block v-for="(item,index) in dataList" :key="index">
		<view class="order_list">
			<view class="list_l">
				<image v-if="item.avatar" :src="baseUrl+item.avatar"></image>
				<image v-else :src="item.headimgurl"></image>
				<view class="list_info">
					<view v-if="item.username" class="list_title">{{item.username}}</view>
					<view v-else class="list_title">{{item.nickname}}</view>
					<view class="list_inform">{{item.tel_phone}}<text style="margin-left:20upx;" v-if="item.sex==1">&nbsp;&nbsp;男&nbsp;&nbsp;</text><text style="margin-left:20upx;" v-else-if="item.sex==2">&nbsp;&nbsp;女&nbsp;&nbsp;</text></view>
					<view class="list_address">{{item.address}}</view>
				</view>
			</view>
		</view>
		</block>
	</view>
</template>

<script>
	import request from '@/common/lib/request.js'
	export default {
		data() {
			return {
				page:1,
				baseUrl:request.common.baseUrl,
				stores:'',
				dataList:[]
			}
		},
		onLoad:function(option){
			this.stores=option
			uni.request({
			    url: request.common.baseUrl+'/api/agent/storeMember',
			    data: {
					page:this.page,
					store_id:option.id
				},
			    header: {
					'Content-Type':'application/json;charset=UTF-8',
					'Content-Type':'application/x-www-form-urlencoded'
			    },
			    success: (res) => {
						if(res.data.code==200){
							this.dataList=res.data.data
						}else{
							uni.showToast({
							    title: '暂无数据',
								icon: 'none',
							    duration: 2000
							});
						}
			    }
			});
		},
		methods: {
		},
		onReachBottom:function(){
			this.page=this.page+1
			uni.request({
			    url: request.common.baseUrl+'/api/agent/storeMember',
			    data: {
					page:this.page,
					store_id:this.stores.id
			    },
			    header: {
					'Content-Type':'application/json;charset=UTF-8',
					'Content-Type':'application/x-www-form-urlencoded'
			    },
			    success: (res) => {
			        if(res.data.code==200){
						for (var j = 0; j < res.data.data.length; j++) {
							this.dataList.push(res.data.data[j])
						}
					}else{
						uni.showToast({
						    title: '暂无数据',
							icon: 'none',
						    duration: 2000
						});
					}
			    }
			});
		}
	}
</script>

<style>
page{
	background-color:#FFFFFF;
}
.order_list{
	border-bottom:1upx solid #f6f6f6;
	width:700upx;
	height:150upx;
	padding-top:10upx;
	padding-bottom:10upx;
}
.list_l{
	float:left;
	margin-top:10upx;
}
.list_l image{
	width:100upx;
	height:100upx;
	float:left;
	margin-left:10upx;
	border-radius:50upx;
}
.list_info{
	float:left;
	margin-left:20upx;
}
.list_title{
	font-size:30upx;
	color:#111111;
}
.list_inform{
	font-size:24upx;
	color:#999999;
}
.list_address{
	font-size:24upx;
	color:#999999;
}
</style>
